// 1. 导入mongoose模块
const mongoose = require('mongoose')
// 2. 连接数据库
mongoose.connect('mongodb://localhost/0907')
// 3. 创建连接成功回调
mongoose.connection.on('open',()=>{
    console.log("连接成功");
})
// 4. 创建连接失败回调
mongoose.connection.on('error',()=>{
    console.log("连接失败");
})
// 5. 导出mongoose
module.exports = mongoose;
